ccR.Add_Rotation(
	1, -- Player Specialization
	"CC_Mage_Arcane_Solo", -- Function name
	"Developed early WoD, Not recommended.", -- Description
	"CC_Mage_Arcane_Talents", -- Talents button frame
	"CC_Mage_Arcane_Abilities", -- Abilities button frame
	"CC_Mage_Arcane_Features", -- Features button frame
	"CC_Mage_Arcane_Setup" -- Setup button frame
)
function CC_Mage_Arcane_Solo()
	-- Prevent interupting Arcane Missiles
	if ccR.Player.IsChannelingSpell(ARCANE_MISSILES) then return end

	-- Ice Barrier
	if ccR.Spell.IsReady(ICE_BARRIER) and not ccR.Player.HasBuff(ICE_BARRIER) then for x = 1, # ccR_Enemies_Within_44 do local vObject = ccR_Enemies_Within_44[x] if ccR.Unit.Exists(vObject) and ccR.Unit.IsAlive(vObject) and ccR.Unit.TargetName(vObject) == ccR.Player.Name() then ccR.Cast.Spell(ICE_BARRIER) end end end
	-- Ice Ward
	if ccR.Spell.IsReady(ICE_WARD) and not ccR.Player.HasBuff(ICE_WARD) then for x = 1, # ccR_Enemies_Within_44 do local vObject = ccR_Enemies_Within_44[x] if ccR.Unit.Exists(vObject) and ccR.Unit.IsAlive(vObject) and ccR.Unit.TargetName(vObject) == ccR.Player.Name() then ccR.Cast.Spell(ICE_WARD,"player") end end end
	-- Frost Nova
	if ccR.Spell.IsReady(FROST_NOVA) and ccR.Player.Count(12) > 0 then ccR.Cast.Spell(FROST_NOVA) end
	-- Cone of Cold
	if ccR.Spell.IsReady(CONE_OF_COLD) and ccR.Player.Count(8) > 0 then ccR.Cast.Spell(CONE_OF_COLD) end
	-- Player is moving
	if ccR.Player.IsMoving() then	
		-- Nether Tempest ALL enemies when moving
		for x = 1, # ccR_Enemies_Within_44 do
			local vObject = ccR_Enemies_Within_44[x]
			if ccR.Unit.Exists(vObject)
			and ccR.Unit.IsAlive(vObject)
			and (ccR.Unit.IsTappedByPlayer(vObject) or ccR.Unit.TargetName(vObject) == ccR.Player.Name())
			and ccR.Spell.CanAttack(NETHER_TEMPEST, vObject)
			and not ccR.Unit.HasMyDebuff(vObject, NETHER_TEMPEST)
			then
				ccR.Cast.Attack(NETHER_TEMPEST, vObject)
			end
		end
		---
	end

	if ccR.Player.Count(12) > 4 and ccR.Spell.IsReady(ARCANE_EXPLOSION) then ccR.Cast.Spell(ARCANE_EXPLOSION) end

	-- Target Exists
	if ccR.Target.Is.Attackable() then
		-- Player is in combat
		if ccR.Player.IsInCombat() then
			-- Arcane Power
			if ccR.Spell.IsReady(ARCANE_POWER) then ccR.Cast.Spell(ARCANE_POWER) end
			-- Presence of Mind
			if ccR.Spell.IsReady(PRESENCE_OF_MIND) then ccR.Cast.Spell(PRESENCE_OF_MIND) end
			-- T. Mirror Image
			if ccR.Spell.IsReady(MIRROR_IMAGE) then ccR.Cast.Spell(MIRROR_IMAGE) end
		end
		-- Player is facing Target
		if ccR.Player.IsFacing("target") then
			-- Player is moving and facing target
			if ccR.Player.IsMoving() then
				-- Ice Floes
				if ccR.Spell.IsReady(ICE_FLOES) and not ccR.Player.HasBuff(ICE_FLOES) then ccR.Cast.Spell(ICE_FLOES) return end
				-- Nether Tempest target
				if ccR.Spell.CanAttack(NETHER_TEMPEST) and not ccR.Target.HasMyDebuff(NETHER_TEMPEST) then ccR.Cast.Attack(NETHER_TEMPEST) end
			end
			-- Not moving or has Ice Floes
			if not ccR.Player.IsMoving() or ccR.Player.HasBuff(ICE_FLOES) then
			-- 1. Single Target Rotation
				if ccR.Target.Count(12) > 4 then
					-- T. Ring of Frost
					if ccR.Spell.IsReady(RING_OF_FROST) and ccR.Player.HasTalent(RING_OF_FROST) then ccR.Cast.Spell(RING_OF_FROST) if SpellIsTargeting() then CastAtPosition(ObjectPosition("target")) end end
				end
				-- T. Frostjaw
				if ccR.Spell.CanAttack(FROSTJAW) and ccR.Player.HasTalent(FROSTJAW) then ccR.Cast.Attack(FROSTJAW) end
				-- T. Rune of Power
				if ccR.Spell.IsReady(RUNE_OF_POWER) and ccR.Player.HasTalent(RUNE_OF_POWER) and not ccR.Player.HasBuff(RUNE_OF_POWER_BUFF) and not ccR.Player.IsMoving() then ccR.Cast.Spell(RUNE_OF_POWER) if SpellIsTargeting() then CastAtPosition(ObjectPosition("player")) end end
				-- T. Nether Tempest
				if ccR.Spell.CanAttack(NETHER_TEMPEST) and ccR.Player.DebuffStacks(ARCANE_CHARGE) == 4 and (not ccR.Target.HasMyDebuff(NETHER_TEMPEST) or ccR.Target.DebuffDuration(NETHER_TEMPEST, "<", 3)) then ccR.Cast.Attack(NETHER_TEMPEST) end
				-- T. Super Nova
				if ccR.Spell.CanAttack(SUPER_NOVA) then ccR.Cast.Attack(SUPER_NOVA) end
				-- 4. Arcane Missiles with 4 Arcane Charge or 3 Arcane Missiles
				if ccR.Spell.CanAttack(ARCANE_MISSILES) and (ccR.Player.DebuffStacks(ARCANE_CHARGE) == 4 or ccR.Spell.Charges(ARCANE_MISSILES_BUFF) == 3) then ccR.Cast.Attack(ARCANE_MISSILES) end
				-- 5. Arcane Blast above 93% mana
				-- if ccR.Spell.CanAttack(ARCANE_BLAST) and ccR.Player.Mana() >= 93 then ccR.CastAttack(ARCANE_BLAST) end
				-- 6. Arcane Missiles with 4 stacks of Arcane Charge
				if ccR.Spell.CanAttack(ARCANE_MISSILES) and ccR.Player.DebuffStacks(ARCANE_CHARGE) == 4 then ccR.Cast.Attack(ARCANE_MISSILES) end
				-- 7. Arcane Barrage at 4 Stacks of Arcane Charge
				if ccR.Spell.CanAttack(ARCANE_BARRAGE) and ccR.Player.DebuffStacks(ARCANE_CHARGE) == 4 then ccR.Cast.Attack(ARCANE_BARRAGE) end
				-- 8. Arcane Blast
				if ccR.Spell.CanAttack(ARCANE_BLAST) then ccR.Cast.Attack(ARCANE_BLAST) end
			end
		end
	end
end